import { network } from '@/utils';
import { BoxManagementParams } from './data';

import { basic } from '../../../../../config/Apis';

export async function queryBoxManagementList(params: BoxManagementParams) {
  return network.get(basic.chest_list, { params });
}

export async function operChangeStatus(params: { id: number}) {
  return network.put(basic.chest_disable, { data: params });
}

export async function queryGardenList(params: any) {
  params = {
    ...params,
    pageIndex: 1,
    pageSize: 1000,
  };
  return network.get(basic.garden_list, {
    params,
  });
}

export async function downloadFile(id: number) {
  window.location.href = `${basic.chest_qrcode}?id=${id}`;
}

export async function queryBluetooth() {
  return network.get(basic.chest_btLock);
}

export async function queryFirmware(params: { type: number }) {
  return network.get(basic.chest_struct, { params });
}
